<?php
/**
 * Created by PhpStorm.
 * User: zhangrongxiang
 * Date: 2018/2/13
 * Time: 下午12:12
 */

$arr = [
	'China',
	'JiangSu',
	'XuZhou',
	'DaPi'
];

$arr2 = array_map( function ( $val ) {
	return 'I Love ' . $val;
}, $arr );
//[0] => China
//[1] => JiangSu
//[2] => XuZhou
//[3] => DaPi
print_r( $arr );
//[0] => I Love China
//[1] => I Love JiangSu
//[2] => I Love XuZhou
//[3] => I Love DaPi
print_r( $arr2 );

$arr3 = array_map( function ( $val1, $val2 ) {
	return [ chr( $val1 ) => chr( $val2 ) ];
}, range( 97, 100 ), range( 65, 68 ) );
print_r( $arr3 );
$arr4 = array_map(function ($val){
	return current($val);
},$arr3);
print_r($arr4);

$arr5 = array_map( null, range( 'a', 'd' ), range( 65, 68 ) );

print_r($arr5);